
package pl.com.qapps.datastore;

import java.util.Arrays;

import com.google.storage.onestore.v3.OnestoreEntity.EntityProto;
import com.google.storage.onestore.v3.OnestoreEntity.Path;
import com.google.storage.onestore.v3.OnestoreEntity.Path.Element;
import com.google.storage.onestore.v3.OnestoreEntity.Reference;

class ReferenceUse {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		EntityProto proto = new EntityProto();
		Reference key = new Reference();
		key.setApp("gdrive");
		key.setNameSpace("custom namespace");
		Path path = new Path();
		
		Element element = new Element();
		element.setType("custom type");
		element.setId(564L);
		element.setName("person");
		
		Element e2 = new Element();
		e2.setType("custom type");
		e2.setId(564L);
		e2.setName("person");
		
		path.addElement(element);
		path.addElement(e2);
		key.setPath(path);
		System.out.println(path);
		System.out.println("---------------------------------------");
		System.out.println(key);
		System.out.println(Arrays.toString(key.toByteArray()));
		System.out.println(key.toByteArray().length);
	}

}
